package com.jcl.cloud.services.crawler.email.controller;


import com.jcl.cloud.services.crawler.email.service.CatchEmailManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(
        value = {"/catch-email/api/v1"},
        produces = {"application/json"}
)
public class TaskController {

    @Autowired
    private CatchEmailManagerService catchEmailManagerService;

    @RequestMapping(
            value = {"/manager/tasks"},
            method = {RequestMethod.GET}
    )
    public void createTask(String crawlerId){

        try {
            this.catchEmailManagerService.createCatchEmailTask(crawlerId);
        } catch (Exception e) {
            e.printStackTrace();
        }


    }


}
